<script>
    export default {
        onLaunch: function() {
            console.log('App Launch');
            // #ifdef APP-PLUS
            // 锁定屏幕方向
            plus.screen.lockOrientation('portrait-primary'); //锁定
            // 检测升级
            uni.request({
                url: 'https://uniapp.dcloud.io/update', //检查更新的服务器地址
                data: {
                    appid: plus.runtime.appid,
                    version: plus.runtime.version,
                    imei: plus.device.imei
                },
                success: (res) => {
                    console.log('success', res);
                    if (res.statusCode == 200 && res.data.isUpdate) {
                        let openUrl = plus.os.name === 'iOS' ? res.data.iOS : res.data.Android;
                        // 提醒用户更新
                        uni.showModal({
                            title: '更新提示',
                            content: res.data.note ? res.data.note : '是否选择更新',
                            success: (showResult) => {
                                if (showResult.confirm) {
                                    plus.runtime.openURL(openUrl);
                                }
                            }
                        })
                    }
                }
            })

            var domModule = weex.requireModule('dom');
            domModule.addRule('fontFace', {
                'fontFamily': "uniicons",
                'src': "url('./static/uni.ttf')"
            });
            // #endif
        },
        onShow: function() {
            console.log('App Show')
        },
        onHide: function() {
            console.log('App Hide')
        }
    }
</script>

<style>
    
    /* @import './common/uni.css'; */

    /* 以下样式用于 hello uni-app 演示所需 */
    page {
        background-color: #F4F5F6;
        width: 100%;
        height: 100%;
        font-size: 28upx;
        line-height: 1.8;
    }
	.box-item {
		display: flex;
		flex-direction: row;
		justify-content: center;
		width: 100%;
		border: 1.5px solid #D3D3D3;
		margin-top: -1.5px;
		height: 100upx;
		background-color: white;
	}
	.item-in {
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		width: 90%;
		height: 100%;
	}
	.item-left {
		display: flex;
		flex-direction: row;
		justify-content: flex-start;
		align-items: center;
	}
	.item-right {
		display: flex;
		flex-direction: row;
		justify-content: flex-end;
		align-items: center;
	}
	.right-icon {
		color: black;
	}
	.item-title {
		padding-left: 24upx;
	}
	.login-button {
		width: 80%;
		height: 100upx;
		border-radius: 40upx;
		margin-top: 50upx;
		background-color: #2AB795;
	}
	.buttons {
		display: flex;
		flex-direction: row;
		flex-wrap: wrap;
		width: 90%;
		margin-left: 5%;
		justify-content: space-between;
		margin-top: 20upx;
	}
	.button {
		border-radius: 33upx;
		height: 66upx;
		width: 150upx;
		line-height: 60upx;
		background-color: white;
		border: 1px solid gray;
		color: black;
		margin-top: 25upx;
	}
</style>
